﻿<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page import="java.util.*" %>
<%@ page import="com.burry.services.GoodService" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ taglib prefix="s" uri="/struts-tags"%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Bary</title>
<!--Script and CSS includes for YUI dependencies on this page-->
<link rel="stylesheet" type="text/css" href="Resource/yui/build/tabview/assets/skins/sam/tabview.css" />
<link rel="stylesheet" type="text/css" href="Resource/yui/build/button/assets/skins/sam/button.css" />
<link rel="stylesheet" type="text/css" id="css" href="Resource/css/main.css">
<link rel="stylesheet" type="text/css" id="css" href="Resource/css/css.css">
<link rel="stylesheet" type="text/css" id="css" href="Resource/css/good.css">
<script type="text/javascript" src="Resource/yui/build/yuiloader/yuiloader-beta-min.js"></script>
<script type="text/javascript" src="Resource/yui/build/event/event-min.js"></script>
<script type="text/javascript" src="Resource/yui/build/dom/dom-min.js"></script>
<script type="text/javascript" src="Resource/yui/build/element/element-beta-min.js"></script>
<script type="text/javascript" src="Resource/yui/build/tabview/tabview-min.js"></script>
<script type="text/javascript" src="Resource/yui/build/button/button-min.js"></script>
<script language="JavaScript" type="text/JavaScript" src="Resource/js/cs.js"></script>
<script language="JavaScript" type="text/JavaScript" src="Resource/js/core.js"></script>
 <%
  	GoodService gs = new GoodService();
  	List goodList = gs.getAllColorPic();
  		//out.println(goodList);
  	String goodId = request.getParameter("good_id");
 %>

<script language="javascript">
	function save(){
		var checkList = (document.allGood.inputGoodId);
		var result = "";
		for(var i=0;i<checkList.length;i++){
			var checkItem = checkList[i];
			if(checkItem.checked){
				result = result + checkItem.value + "|";
				
			}
		}
		
		location.href = "addSomePro.do?inputGoodId=<%=goodId%>&proId="+result;
		
	}
	
	function goBack(){
		location.href = "goodList.do";
	}
</script>
</head>
<body id="yahoo-com" class=" yui-skin-sam">
  <div id="framed">
    <h2>推荐商品</h2>
  </div>
  

  <div>
  	
  	<form action="" name="allGood">
      <table>
      	<tr><td>商品编号</td><td>版色编号</td><td>缩略图</td><td>勾选</td></tr>
      	<%
      		for(int i=0;i<goodList.size();i++){
      			Map t = (Map)goodList.get(i);
      	%>
      	<tr><td><%=t.get("good_id")%></td>
      		<td><%=t.get("color_id")%></td>
      		<td><%=t.get("prd_list_pic")%></td>
      		<td><input type="checkbox" name="inputGoodId" value="<%=t.get("good_id")%>"/></td>
      		</tr>
      	
      	<%
      		}
      	%>
      </table>    
      
      <input type="button" onclick="save()" value="保存" />  &nbsp; <input type="button" onclick="goBack()" value="返回" />
		</form>

  </div>
</body>
</html>
